import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description: 求和
 * User: 王圆豪
 * Date: 2024-09-06
 * Time: 23:56
 */
public class Main {
    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        long startTime = System.currentTimeMillis();
        int n = sc.nextInt();
        int k = 0;
        int result = 0;
        for (int i = 1; i <= n; i++) {
            k += i;
            result += k;
        }
        System.out.println(result);
        long endTime = System.currentTimeMillis();
        System.out.println(endTime - startTime);

        startTime = System.currentTimeMillis();
        n = sc.nextInt();
        k = 0;
        result = 0;
        for (int i = 1; i <= n; i++) {
            k = (i * (i + 1)) / 2;
            result += k;
        }
        System.out.println(result);
        endTime = System.currentTimeMillis();
        System.out.println(endTime - startTime);

        startTime = System.currentTimeMillis();
        n = sc.nextInt();
        result = (n * (n + 1) * (n + 2)) / 6;
        System.out.println(result);
        endTime = System.currentTimeMillis();
        System.out.println(endTime - startTime);
    }
}
